package com.LeetCode;

import java.util.ArrayList;
import java.util.Arrays;

public class _88合并数组
{

    public static void main(String[] args)
    {
        int num1[] = new int[]{4, 2, 5, 0, 0, 0};
        int num2[] = new int[]{2, 5, 6};
        merge(num1, 3, num2, 3);
        System.out.println(num1[0]);
        System.out.println(num1[1]);
        System.out.println(num1[2]);
        System.out.println(num1[3]);
        System.out.println(num1[4]);
        System.out.println(num1[5]);
    }

    public static void merge(int[] nums1, int m, int[] nums2, int n)
    {
        System.arraycopy(nums2, 0, nums1, m, n);
        Arrays.sort(nums1);
    }

}
